<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="UTF-8">
		<title>登录</title>
		<link rel="stylesheet" href="/common/css/base.css">
    	<link rel="stylesheet" href="/common/css/index_head.css">
		<link rel="stylesheet" href="/common/css/footer.css">
		<link rel="stylesheet" href="/auth/css/login.css">
	</head>
	<body>
		<div id="error" th:if="${error!=null && error.msg != null}" th:attr="error=${error.msg}"></div>

		<div class='header'>
		<div class="top">
			<div class="w clearfix">
				<div class='setNav fr'>
					<ul>
						<li id="userFather">
							<a th:if="${session.loginUser == null}" id="login_btn" href="http://localhost:11000/auth/login.html" >
								登录
							</a>
							<a th:if="${session.loginUser == null}" href="http://localhost:11000/auth/reg.html">
								注册
							</a>
							<a th:if="${session.loginUser != null}">
								欢迎, [[${session.loginUser.nickname}]]
							</a>
							<a th:if="${session.loginUser != null}" href="http://localhost:11000/auth/logout.html">
								立即退出
							</a>
						</li>
						<li class="line">
						</li>
						<li>
							<a href="http://localhost:11000/orderList.html">我的订单</a>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<!-- //顶部按钮区域结束 -->
		<div class="w">
			<div class="top_search clearfix">
				<a href="http://localhost:11000">
					<div class="logo fl">
						<h1></h1>
					</div>
				</a>
				<div class="search fl">
					<form action="http://localhost:11000/list.html" method="get" style="display: flex">
						<input name="keyword" type="text" id="ipt" placeholder="">
						<button>搜索</button>
						<ul id="list"></ul>
					</form>
				</div>
				<div class="shop_car fr">
					<a href="http://localhost:11000/cart/cart.html">购物车</a>
				</div>
			</div>
		</div>
		<!-- logo及 搜索框结束 -->
		<div class="w">
			<div class="tab clearfix">
				<div class="fl s_show">
					<a href="" class="logo_s"></a>
				</div>
				<ul class="fl clearfix" >
					<li class="tabItem">
						<a href="http://localhost:11000">首页</a>
					</li>
					<li class="tabItem" th:each="cat1:${category}">
						<a href="" th:text="${cat1.getName()}">居家生活</a>
						<div class="tabChild clearfix">
							<dl th:each="cat2:${cat1.getCat2()}">
								<dt th:text="${cat2.getName()}">夏季焕新</dt>
								<dd th:each="cat3:${cat2.getCat3()}">
									<a th:href="@{'/list.html?catalog3Id='+${cat3.getId()}}">
										<span th:text="${cat3.getName()}">夏凉尝鲜</span>
									</a>
								</dd>
							</dl>
						</div>
					</li>
				</ul>
				<div class="fr s_hide">
					<a href="">为你严选</a>
					<a href="">众筹</a>
				</div>
				<div class="fr s_show">
                <span class="log fl">
                        <ul class='setItem'>
                            <li th:if="${session.loginUser == null}">
                                <a href="http://localhost:11000/auth/login.html" >
                                    登录
                                </a>
                            </li>
                            <li th:if="${session.loginUser == null}">
                                <a href="http://localhost:11000/auth/reg.html">
                                    注册
                                </a>
                            </li>
                            <li th:if="${session.loginUser != null}">
                                <a href="http://localhost:11000/auth/logout.html">
                                    退出
                                </a>
                            </li>
                        </ul>
                    </span>
					<a href="http://localhost:11000/cart/cart.html">
                    <span class="show_car fl">
                    </span>
					</a>
				</div>
			</div>

		</div>
		<!-- tab区域结束 -->
	</div>
		 <!-- 头部区域结束 -->
		<div class="container">
			<div class="main">
				<div class="login-page">
					<div class="head">帐号登录</div>
					<form class="body" action="/auth/login" method="post">
						<div class="inputBox">
							<div class="u-logo">
								<p class="u-logo-img"></p>
							</div>
							<div class="u-input">
								<input type="text" name="loginacct" class="input-text" id="usernameInput" placeholder="邮箱/账号">
							</div>
							<div class="u-tip">
								<p class="u-clear"></p>
							</div>
						</div>
						<div class="separate"></div>
						<div class="inputBox">
							<div class="u-logo">
								<p class="u-logo-img password"></p>
							</div>
							<div class="u-input">
								<input type="password" name="password" class="input-text" id="passwordInput" placeholder="输入密码">
							</div>
						</div>
						<div class="login-box">
							<button type="submit">登&nbsp;录</button>
						</div>
						<div class="unlogin">
							<a href="#" class="forget-pwd">忘记密码？</a>
							<a href="http://localhost:11000/auth/reg.html" class="change-page" >去注册</a>
						</div>
					</form>
				</div>
			</div>
		</div>
		<script src="./font/iconfont.js"></script>

</body>
<script src="/common/js/jquery.js"></script>
<script>

	$(document).ready(function () {
		alertError();
	})

	function alertError() {
		if ($("#error").length > 0){
			let error = $("#error").attr("error");
			alert(error)
		}
	}

</script>
</html>
